<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.model.Building"%>
<%@ page import="com.model.Rate"%>
<%@ page import="com.control.BuildingControl"%>
<%@ page import="com.control.RateControl"%>
<%@ page import="com.util.PageResultSet"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>我的寝室卫生情况</title>
	</head>
	<body>
		<%
			request.setCharacterEncoding("utf-8");
			String ToolBar = "";
	   		int curPage = 1;
			int stu_id = (Integer)session.getAttribute("user_id");
			RateControl rc = new RateControl();
			ArrayList<Rate> ratelist = new ArrayList<Rate>();
			ratelist = rc.getRate(stu_id);
			if(request.getParameter("cur_page")!= null) {
				curPage = Integer.parseInt(request.getParameter("cur_page")); 
			}
			PageResultSet p = new PageResultSet(ratelist,curPage);
			ArrayList<Rate> nowlist = new ArrayList<Rate>();
			nowlist = (ArrayList<Rate>)p.getData();
		%>
		<table width="98%" border="0" align="center">
			<tr>
				<td></td>
			</tr>
			<tr>
				<td></td>
			</tr>
			<tr>
				<td>
					<fieldset>
						<legend>
							我的寝室卫生状况
						</legend>
						<form action="healthInfo_show.jsp" name="form1" method="post">
							<table width="70%" border="0" align="center" cellspacing="0"
								cellpadding="0">
								<tr>
									<td height="20"></td>
								</tr>
								<tr>
									<td>
										<table border="1" width="99%" align="center" cellpadding="0"
											cellspacing="1" class="resultTable">
											<tr>
												<td width="3%" height="25" align="center" bgcolor="#D9F0FF">
													寝室
												</td>
												<td width="3%" height="25" align="center" bgcolor="#D9F0FF">
													寝室长
												</td>
												<td width="2%" height="25" align="center" bgcolor="#D9F0FF">
													卫生等级
												</td>
												<td width="4%" height="25" align="center" bgcolor="#D9F0FF">
													管理员评价
												</td>
												<td width="4%" height="25" align="center" bgcolor="#D9F0FF">
													评价人
												</td>
												<td width="4%" height="25" align="center" bgcolor="#D9F0FF">
													评价日期
												</td>
											</tr>
											<%
												for (int i = 0; i < nowlist.size(); i++) {
													Rate rate = nowlist.get(i);
											%>
											<tr>
												<td height="25" align="center"><%=rate.getDorm_name()%></td>
												<td height="25" align="center"><%=rate.getDorm_leader()%></td>
												<td height="25" align="center"><%=rate.getRate_score()%></td>
												<td height="25" align="center"><%=rate.getRate_des()%></td>
												<td height="25" align="center"><%=rate.getAdmin_name()%></td>
												<td height="25" align="center"><%=rate.getRate_time()%></td>
											</tr>
											<%
											}
												String fileName = "healthInfo_show.jsp";
												ToolBar = p.getToolBar(fileName);
											%>
										</table>
										<%=ToolBar %>
									</td>
								</tr>
							</table>
						</form>
					</fieldset>
				</td>
			</tr>
		</table>
	</body>
</html>
